package com.iterator.util;

import java.util.regex.Pattern;

/**
 * 金额校验 by homePage
 */
public class MoneyVaildateUtil {
    public static Boolean moneyVaildate (Object o){
        Boolean flag =false;
        try{
            if (o != null) {
                String s = o.toString();
                Pattern pattern = Pattern.compile("^[+]?([0-9]+(.[0-9]{1,2})?)$");
                if(pattern.matcher(s).matches()){
                    flag=true;
                }
            }
        }catch (Exception e){
            e.getMessage();
        }
        return flag;
    }
}
